inspector: Make the action editor more useful
authorMatthias Clasen <mclasen@redhat.com>
Wed, 30 Jul 2014 21:46:13 +0000 (23:46 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 30 Jul 2014 21:46:13 +0000 (23:46 +0200)
We were not finding the action owner for menuitems, we have to
try harder to walk all the way up to the window.

gtk/inspector/prop-editor.c

index 2e78da9713b27b91f30d7d67e1a9aa82ac3b41e8..3b19e8161e7eac3bd72a94932aa2138595e09862 100644 (file)
@@ -1253,22 +1253,20 @@ find_action_owner (GtkActionable *actionable)
   if (g_strcmp0 (prefix, "win") == 0)
     {
       if (G_IS_OBJECT (win))
-      return (GObject *)win;
+        return (GObject *)win;
     }
   else if (g_strcmp0 (prefix, "app") == 0)
     {  
       if (GTK_IS_WINDOW (win))
         return (GObject *)gtk_window_get_application (GTK_WINDOW (win));
     }
-  else
+
+  while (widget != NULL)
     {
-      while (widget != NULL)
-        {
-          group = _gtk_widget_get_action_group (widget, prefix);
-          if (group && g_action_group_has_action (group, name))
-            return (GObject *)widget;
-          widget = action_ancestor (widget);
-        }
+      group = _gtk_widget_get_action_group (widget, prefix);
+      if (group && g_action_group_has_action (group, name))
+        return (GObject *)widget;
+      widget = action_ancestor (widget);
     }
 
   return NULL;